home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / c / c-bat-0.1n / c-bat-0 / c-bat-0.1 / README.programming < prev    next >
Encoding:
Text File  |  1994-06-16  |  29.4 KB  |  790 lines

  1. O.K, this is even less than a README, it's just a generated list of the
  2. browser-function, but I do not have very much time at the moment.
  3.  
  4. I hope you can follow my comments in order to use the browser-functions.
  5. Please look also into the source-files of the sample clients.
  6.  
  7.  
  8. /*********************************************************
  9.  Short overview:
  10.  
  11.  A Client has first to connect to a server to which it
  12.  can send information requests and get the results.
  13.  
  14.  Normally, the functions defined in this module do
  15.  automatically connect to the master-server, which is
  16.  the first (or only) server started. However, a client
  17.  can connect to an other server if it knows it's server-ID.
  18.  
  19.  This ID can be obtained by the get_server_id function
  20.  which asks the master server for the ID of the server
  21.  which processes a special browser file.
  22.  
  23.  Each client can only be connected to one server at a given
  24.  time. However, you can switch to an other server by first 
  25.  disconnect the old one and then connect to the new
  26.  server.
  27.  
  28.  All functions send the request to the server when they are
  29.  called for the first time. If they can return more than
  30.  one return-value, the have to be called multiple times.
  31.  After the last value has been returned, these functions
  32.  return RET_END instead of 0.
  33.  
  34.  For the documentation of the functions, please look in the
  35.  comments preceeding these functions.
  36.  
  37.  ****************************************/
  38.  
  39.  
  40. List of all browser-function:
  41.  
  42. brs_get_all_funct            all functions in a project
  43. brs_get_all_global_vars      all global variables in a project
  44. brs_get_funct_calls          all function calls in a function
  45. brs_get_var_uses             all variables used in a function
  46. brs_get_funct_called_by      all functions calling a function
  47. brs_get_var_used_by          all functions using a variable
  48. brs_get_includes             all include files of a source-file
  49. brs_get_funct_pos            definition position of a function
  50. brs_get_var_pos              definition position of a global variable
  51. brs_get_all_types            all typedef's, struct's and union's
  52. brs_get_component_use        usage of a struct or union component
  53. brs_reinit_browser           reinit the server with new browser-file
  54. brs_get_server_id            get ID of server processing given .brc-file
  55. brs_disconnect_server        disconnect the current server
  56. brs_connect_server           connect to server with given ID
  57. brs_get_all_files            all files in the project
  58. brs_get_file_dir             working directory of a source-file
  59. brs_get_all_macro            all macro-definitions in project
  60. brs_what_is                  type and definition-pos of an identifier
  61. brs_get_macro_pos            position of a macro definition
  62. brs_cut                      cut definition lines from source-files
  63. brs_get_item_pos             position of an ident with unknown type
  64.  
  65. ================================================================================
  66. Function   : brs_connect_server
  67. File       : clients.c    Line 76
  68. Length     : 32 Lines
  69. Declaration:
  70. short brs_connect_server(int server_id)
  71. --------------------------------------------------------------------------------
  72. /* connects to server;
  73.  
  74.    return:  0    ...  O.K.
  75.             else ...  Return-value from server
  76. */
  77.  
  78.  
  79. ================================================================================
  80. Function   : brs_disconnect_server
  81. File       : clients.c    Line 114
  82. Length     : 11 Lines
  83. Declaration:
  84. void brs_disconnect_server(void)
  85. --------------------------------------------------------------------------------
  86. /* disconnects actual server
  87.  
  88.    A client may only be connected to one server at a time
  89.  
  90. */
  91.  
  92.  
  93. ================================================================================
  94. Function   : brs_get_all_files
  95. File       : clients.c    Line 1198
  96. Length     : 55 Lines
  97. Declaration:
  98. short brs_get_all_files( char *file, char *module)
  99. --------------------------------------------------------------------------------
  100. /* This function returns all files in a project (just main-files, not the
  101.    includes)
  102.    strings should be have a size of at least STRINGSIZE Bytes
  103.  
  104.    The first time, this function is called, it issues the 
  105.    CMD_FILES-command to the server.
  106.  
  107.    Return-values:
  108.  
  109.      file    ...  filename
  110.      module  ...  module, where file belongs to
  111.  
  112.    return:  0        ...  O.K., function-info is stored in arguments
  113.             RET_END  ...  No more functions found
  114.             else     ...  error returned by get_brs_ret
  115.                           error-message in funct/file
  116.  */
  117.  
  118.  
  119. ================================================================================
  120. Function   : brs_get_all_funct
  121. File       : clients.c    Line 194
  122. Length     : 60 Lines
  123. Declaration:
  124. short brs_get_all_funct( char *funct, char *file, long *line, char *module, short *static_flag)
  125. --------------------------------------------------------------------------------
  126. /* This function returns all functions defined in the project.
  127.    strings should be have a size of at least STRINGSIZE Bytes
  128.  
  129.    funct        ...   holds the name of the function,
  130.    file         ...   the file, where the function is defined (or "" if unknown)
  131.    line         ...   the line in the file, where function is defined (if known)
  132.                       linenumber is the first line after the ')' of the arguments
  133.    module       ...   module to which this file belongs to (or "" if not known)
  134.    static_flag  ...   1 if function is static, 0 else
  135.  
  136.    The first time, this function is called, it issues the 
  137.    CMD_FUNCTIONS-command to the server.
  138.    This function should be called with a NULL-pointer in funct
  139.    to reset internal flags if you want to get all functions a
  140.    second time. However, it does a self-reset, it the RET_END-value 
  141.    is returned by the server.
  142.  
  143.    return:  0        ...  O.K., function-info is stored in arguments
  144.             RET_END  ...  No more functions found
  145.             else     ...  error returned by get_brs_ret
  146.                           error-message in funct/file
  147.  */
  148.  
  149.  
  150. ================================================================================
  151. Function   : brs_get_all_global_vars
  152. File       : clients.c    Line 261
  153. Length     : 60 Lines
  154. Declaration:
  155. short brs_get_all_global_vars( char *funct, char *file, long *line, char *module, short *static_flag)
  156. --------------------------------------------------------------------------------
  157. /* This function returns all local variables defined in project.
  158.  
  159.    it works like "get_all_funct" !
  160.  */
  161.  
  162. Functions called from files:
  163.        clients.c   intrface.c
  164.  
  165. ================================================================================
  166. Function   : brs_get_all_macro
  167. File       : clients.c    Line 1327
  168. Length     : 60 Lines
  169. Declaration:
  170. short brs_get_all_macro( char *macro, char *file, long *line )
  171. --------------------------------------------------------------------------------
  172. /* This function returns all macros defined in the project.
  173.    strings should be have a size of at least STRINGSIZE Bytes
  174.  
  175.    macro        ...   holds the name of the macro
  176.    file         ...   the file, where the macro is defined (or "" if unknown)
  177.    line         ...   the line in the file, where macro is defined (if known)
  178.  
  179.  
  180.    return:  0        ...  O.K., function-info is stored in arguments
  181.             RET_END  ...  No more functions found
  182.             else     ...  error returned by get_brs_ret
  183.                           error-message in macro/file
  184.  */
  185.  
  186.  
  187. ================================================================================
  188. Function   : brs_get_all_types
  189. File       : clients.c    Line 1013
  190. Length     : 67 Lines
  191. Declaration:
  192. short brs_get_all_types( short type_code, char *type_name, char *file, long *line)
  193. --------------------------------------------------------------------------------
  194. /* This function returns all types (structs, unions, typedefs, enums)
  195.    defined in the project.
  196.    strings should be have a size of at least STRINGSIZE Bytes
  197.  
  198.    INPUT: 
  199.    type_code    ...   0 ... structs
  200.                       1 ... unions
  201.                       2 ... enums
  202.                       3 ... typedefs
  203.  
  204.    OUTPUT:
  205.    type_name    ...   holds the name of the type,
  206.    file         ...   the file, where the type is defined (or "" if unknown)
  207.    line         ...   the line in the file, where type is defined (if known)
  208.                       linenumber is the first line after the ')' of the arguments
  209.  
  210.  
  211.    return:  0        ...  O.K., function-info is stored in arguments
  212.             RET_END  ...  No more functions found
  213.             else     ...  error returned by get_brs_ret
  214.                           error-message in funct/file
  215.  */
  216.  
  217.  
  218. ================================================================================
  219. Function   : brs_get_any_message
  220. File       : intrface.c    Line 456
  221. Length     : 17 Lines
  222. Declaration:
  223. short brs_get_any_message(int *type, short *cmd, short *flag, int *pid, long *id, char *buf)
  224. --------------------------------------------------------------------------------
  225. /* Debug-function: returns any message from message-queue
  226.  */
  227.  
  228.  
  229. ================================================================================
  230. Function   : brs_get_component_use
  231. File       : clients.c    Line 1107
  232. Length     : 71 Lines
  233. Declaration:
  234. short brs_get_component_use( int type, char *comp_name, char *f_in, 
  235.                          char *file, long *line, char *function)
  236. --------------------------------------------------------------------------------
  237. /* This function returns the usage of components.
  238.  
  239.    INPUT: 
  240.    type      0   Get all components in a file (or global if arg2 == "")
  241.              1   Get all component references in a function 
  242.              2   Get all components in same line like variable
  243.  
  244.    component_name  ...   name of the target component of a struct/union
  245.  
  246.    arg2          depends on type:  0 ... filename or ""
  247.                                    1 ... function name
  248.                                    2 ... variable name
  249.  
  250.    OUTPUT:
  251.    file         ...   the file, where component used
  252.    line         ...   the line in the file, where component used
  253.    function     ...   ident of function where component used
  254.  
  255.    return:  0        ...  O.K.
  256.             RET_END  ...  No more items found
  257.             else     ...  error returned by get_brs_ret
  258.                           error-message in file/function
  259.  */
  260.  
  261.  
  262. ================================================================================
  263. Function   : brs_get_file_dir
  264. File       : clients.c    Line 1274
  265. Length     : 37 Lines
  266. Declaration:
  267. short brs_get_file_dir( char *file_in, char *dir)
  268. --------------------------------------------------------------------------------
  269. /* This function returns the working directory of a given 
  270.    source-file
  271.  
  272.    INPUT:
  273.    file_in      ...   source-file
  274.  
  275.    OUTPUT 
  276.    (if ret-value is 0:)
  277.    dir          ...   working-directory
  278.  
  279.    (if ret-value if RET_ERROR)
  280.    dir          ...   Error message 1
  281.  
  282.  
  283.    return:  0        ...  O.K., working-directory stored
  284.             else     ...  error returned by get_brs_ret
  285.  */
  286.  
  287.  
  288. ================================================================================
  289. Function   : brs_get_funct_called_by
  290. File       : clients.c    Line 542
  291. Length     : 62 Lines
  292. Declaration:
  293. short brs_get_funct_called_by( char *funct_in, char *file_in, short sym_once,
  294.                      char *funct, char *file, long *line, 
  295.                      char *module, short *static_flag)
  296. --------------------------------------------------------------------------------
  297. /* This function returns every function, that calls the specific
  298.    function
  299.    strings should be have a size of at least STRINGSIZE Bytes
  300.  
  301.    INPUT:
  302.    funct_in     ...   target-function, (just interesting for the first time)
  303.    file_in      ...   file, where target-function is defined (or called: in this
  304.                       case the one with the right scope (global/static) will be
  305.                       taken).
  306.                       may be "", if function is just defined once
  307.    sym_once     ...   if set to 1, every function is just returned once,
  308.                       otherwise every single call will be returned.
  309.  
  310.    OUTPUT 
  311.    (if ret-value is 0:)
  312.    funct        ...   holds the name of the function,
  313.    file         ...   the file, where the target-function is called
  314.    line         ...   linenumber, where target-function is called
  315.    module       ...   always ""
  316.    static_flag  ...   1 if function is static, 0 else
  317.  
  318.    (if ret-value if RET_ERROR)
  319.    funct        ...   Error message 1
  320.    file         ...   Error message 2 (might be "")
  321.  
  322.  
  323.    The first time, this function is called, it issues the 
  324.    CMD_...-command to the server.
  325.    This function should be called with a NULL-pointer in funct
  326.    to reset internal flags if you want to get all functions a
  327.    second time. However, it does a self-reset, it the RET_END-value 
  328.    is returned by the server.
  329.  
  330.    return:  0        ...  O.K., function-info is stored in arguments
  331.             RET_END  ...  No more functions found
  332.             else     ...  error returned by get_brs_ret
  333.  */
  334.  
  335.  
  336. ================================================================================
  337. Function   : brs_get_funct_calls
  338. File       : clients.c    Line 364
  339. Length     : 62 Lines
  340. Declaration:
  341. short brs_get_funct_calls( char *funct_in, char *file_in, short sym_once,
  342.                      char *funct, char *file, long *line, 
  343.                      char *module, short *static_flag)
  344. --------------------------------------------------------------------------------
  345. /* This function returns all functions called by a specific
  346.    function
  347.    strings should be have a size of at least STRINGSIZE Bytes
  348.  
  349.    INPUT:
  350.    funct_in     ...   target-function, (just interesting for the first time)
  351.    file_in      ...   file, where target-function is defined (or called: in this
  352.                       case the one with the right scope (global/static) will be
  353.                       taken)
  354.                       may be "", if function is just defined once
  355.    sym_once     ...   if set to 1, every function is just returned once,
  356.                       otherwise every single call will be returned.
  357.  
  358.    OUTPUT 
  359.    (if ret-value is 0:)
  360.    funct        ...   holds the name of the function,
  361.    file         ...   the file, where the function is called
  362.    line         ...   linenumber, where function is called
  363.    module       ...   always ""
  364.    static_flag  ...   1 if function is static, 0 else
  365.  
  366.    (if ret-value if RET_ERROR)
  367.    funct        ...   Error message 1
  368.    file         ...   Error message 2 (might be "")
  369.  
  370.  
  371.    The first time, this function is called, it issues the 
  372.    CMD_FUNCTIONS-command to the server.
  373.    This function should be called with a NULL-pointer in funct
  374.    to reset internal flags if you want to get all functions a
  375.    second time. However, it does a self-reset, it the RET_END-value 
  376.    is returned by the server.
  377.  
  378.    return:  0        ...  O.K., function-info is stored in arguments
  379.             RET_END  ...  No more functions found
  380.             else     ...  error returned by get_brs_ret
  381.  */
  382.  
  383.  
  384. ================================================================================
  385. Function   : brs_get_funct_pos
  386. File       : clients.c    Line 832
  387. Length     : 43 Lines
  388. Declaration:
  389. short brs_get_funct_pos( char *funct_in, char *file_in,
  390.                      char *file, long *line, long *end_line, char *module)
  391. --------------------------------------------------------------------------------
  392. /* This function returns the position, where a given function
  393.    is defined
  394.  
  395.    INPUT:
  396.    funct_in     ...   target-function
  397.    file_in      ...   file, where target-function is defined (and defined only !)
  398.                       may be "", if function is just defined once
  399.  
  400.    OUTPUT 
  401.    (if ret-value is 0:)
  402.    file         ...   the file, where the function is defined
  403.    line         ...   linenumber, where function is defined
  404.    end_line     ...   linenumber, where function ends
  405.    module       ...   module where file belongs to or ""
  406.  
  407.    (if ret-value if RET_ERROR)
  408.    file         ...   Error message 1
  409.    module       ...   Error message 2 (might be "")
  410.  
  411.  
  412.    return:  0        ...  O.K., function-info is stored in arguments
  413.             else     ...  error returned by get_brs_ret
  414.  */
  415.  
  416.  
  417. ================================================================================
  418. Function   : brs_get_includes
  419. File       : clients.c    Line 746
  420. Length     : 59 Lines
  421. Declaration:
  422. short brs_get_includes(  char *file_in,
  423.                      char *file, char *inc_file, short *sys_flag)
  424. --------------------------------------------------------------------------------
  425. /* This function returns all include-files of a given file.
  426.  
  427.    Every Include is named just once
  428.  
  429.    INPUT:
  430.    file_in      ...   filename of main-file ( xxx.c ), where the browser
  431.                       should look for includes
  432.  
  433.    OUTPUT 
  434.    (if ret-value is 0:)
  435.    file         ...   include-filename
  436.    inc_file     ...   file, where #include-directive was found
  437.                       (may be mainfile or an other headerfile in 
  438.                       case of nested include-levels)
  439.    sys_flag     ...   1 if include-file is a system-header
  440.  
  441.    (if ret-value if RET_ERROR)
  442.    file         ...   Error message 1
  443.    inc_file     ...   Error message 2
  444.  
  445.  
  446.    The first time, this function is called, it issues the 
  447.    CMD_FUNCTIONS-command to the server.
  448.    This function should be called with a NULL-pointer in funct
  449.    to reset internal flags if you want to get all functions a
  450.    second time. However, it does a self-reset, it the RET_END-value 
  451.    is returned by the server.
  452.  
  453.  
  454.    return:  0        ...  O.K., function-info is stored in arguments
  455.             RET_END  ...  No more functions found
  456.             else     ...  error returned by get_brs_ret
  457.  */
  458.  
  459.  
  460. ================================================================================
  461. Function   : brs_get_macro_pos
  462. File       : clients.c    Line 1536
  463. Length     : 41 Lines
  464. Declaration:
  465. short brs_get_macro_pos( char *macro, char *file_in,
  466.                      char *file, long *line, char *module)
  467. --------------------------------------------------------------------------------
  468. /* This function returns the position where given macro
  469.    is defined
  470.  
  471.    INPUT:
  472.    macro        ...   target-macro
  473.    file_in      ...   file, where target-macro is defined
  474.                       may be "", if macro is just defined once
  475.  
  476.    OUTPUT 
  477.    (if ret-value is 0:)
  478.    file         ...   the file, where the macro is defined
  479.    line         ...   linenumber, where macro is defined
  480.    module       ...   module where file belongs to or ""
  481.  
  482.    (if ret-value if RET_ERROR)
  483.    file         ...   Error message 1
  484.    module       ...   Error message 2 (might be "")
  485.  
  486.    return:  0        ...  O.K., variable-info is stored in arguments
  487.             else     ...  error returned by get_brs_ret
  488.  */
  489.  
  490.  
  491. ================================================================================
  492. Function   : brs_get_msg_debug
  493. File       : intrface.c    Line 1599
  494. Length     : 177 Lines
  495. Declaration:
  496. short brs_get_msg_debug(short command, int * server, int *pid, short *ret_cmd, int *ret_id, 
  497.                     short *r_flag, char *arg1, 
  498.                     char *arg2, char *arg3, char *arg4)
  499. --------------------------------------------------------------------------------
  500. /* get messages in queue 
  501.  */
  502.  
  503.  
  504. ================================================================================
  505. Function   : brs_get_server_id
  506. File       : clients.c    Line 133
  507. Length     : 16 Lines
  508. Declaration:
  509. int brs_get_server_id(char *browser_file)
  510. --------------------------------------------------------------------------------
  511. /* sends a browser filename to the master and returns
  512.    the ID of the server processing this file
  513.  
  514.    return-value -1 or -2 : Error
  515.  */
  516.  
  517.  
  518. ================================================================================
  519. Function   : brs_get_var_pos
  520. File       : clients.c    Line 901
  521. Length     : 41 Lines
  522. Declaration:
  523. short brs_get_var_pos( char *var_in, char *file_in,
  524.                      char *file, long *line, char *module)
  525. --------------------------------------------------------------------------------
  526. /* This function returns the position where given global variable
  527.    is defined
  528.  
  529.    INPUT:
  530.    var_in       ...   target-variable
  531.    file_in      ...   file, where target-variable is defined (defined only !)
  532.                       may be "", if variable is just defined once
  533.  
  534.    OUTPUT 
  535.    (if ret-value is 0:)
  536.    file         ...   the file, where the variable is defined
  537.    line         ...   linenumber, where variable is defined
  538.    module       ...   module where file belongs to or ""
  539.  
  540.    (if ret-value if RET_ERROR)
  541.    file         ...   Error message 1
  542.    module       ...   Error message 2 (might be "")
  543.  
  544.  
  545.    return:  0        ...  O.K., variable-info is stored in arguments
  546.             else     ...  error returned by get_brs_ret
  547.  */
  548.  
  549.  
  550. ================================================================================
  551. Function   : brs_get_var_used_by
  552. File       : clients.c    Line 646
  553. Length     : 62 Lines
  554. Declaration:
  555. short brs_get_var_used_by( char *var_in, char *file_in, short sym_once,
  556.                      char *funct, char *file, long *line, 
  557.                      char *module, short *static_flag)
  558. --------------------------------------------------------------------------------
  559. /* This function returns every function, that uses the specific
  560.    variable
  561.    strings should be have a size of at least STRINGSIZE Bytes
  562.  
  563.    INPUT:
  564.    var_in       ...   target-variable, (just interesting for the first time)
  565.    file_in      ...   file, where target-variable is defined (or used: in this
  566.                       case the one with the right scope (global/static) will be
  567.                       taken).
  568.                       may be "", if variable is just defined once
  569.    sym_once     ...   if set to 1, every function is just returned once,
  570.                       otherwise every single usage will be returned.
  571.  
  572.    OUTPUT 
  573.    (if ret-value is 0:)
  574.    funct        ...   holds the name of the function,
  575.    file         ...   the file, where the target-variable is used
  576.    line         ...   linenumber, where target-variable is used
  577.    module       ...   always ""
  578.    static_flag  ...   1 if function is static, 0 else
  579.  
  580.    (if ret-value if RET_ERROR)
  581.    funct        ...   Error message 1
  582.    file         ...   Error message 2 (might be "")
  583.  
  584.  
  585.    The first time, this function is called, it issues the 
  586.    CMD_...-command to the server.
  587.    This function should be called with a NULL-pointer in funct
  588.    to reset internal flags if you want to get all functions a
  589.    second time. However, it does a self-reset, it the RET_END-value 
  590.    is returned by the server.
  591.  
  592.    return:  0        ...  O.K., function-info is stored in arguments
  593.             RET_END  ...  No more functions found
  594.             else     ...  error returned by get_brs_ret
  595.  */
  596.  
  597.  
  598. ================================================================================
  599. Function   : brs_get_var_uses
  600. File       : clients.c    Line 437
  601. Length     : 62 Lines
  602. Declaration:
  603. short brs_get_var_uses( char *funct_in, char *file_in, short sym_once,
  604.                      char *var, char *file, long *line, 
  605.                      char *module, short *static_flag)
  606. --------------------------------------------------------------------------------
  607. /* This function gets all global variables that are used
  608.    by the given function.
  609.  
  610.    It works like "get_funct_calls", so see above
  611.    for dokumentation.
  612.  */
  613.  
  614.  
  615. ================================================================================
  616. Function   : brs_kill_server
  617. File       : clients.c    Line 158
  618. Length     : 9 Lines
  619. Declaration:
  620. short brs_kill_server(void)
  621. --------------------------------------------------------------------------------
  622. /* This function kills server. Return-values like connect_server
  623.    return:  0    ...  O.K.
  624.             else ...  Return-value from server
  625.  */
  626.  
  627. Functions called from files:
  628.        clients.c   intrface.c
  629.  
  630. ================================================================================
  631. Function   : brs_reinit_browser
  632. File       : clients.c    Line 955
  633. Length     : 32 Lines
  634. Declaration:
  635. short brs_reinit_browser( char *file, char *err_msg1, char *err_msg2)
  636. --------------------------------------------------------------------------------
  637. /* This function tells the browser-engine (server1) to re-init with
  638.    a new browser-file
  639.  
  640.    return value:
  641.    0     ... O.K.
  642.    else  ... Error, if RET_ERROR, in err_msg1 and err_msg2 errormessages 
  643.              from server
  644.  */
  645.  
  646.  
  647. ================================================================================
  648. Function   : brs_what_is
  649. File       : clients.c    Line 1428
  650. Length     : 82 Lines
  651. Declaration:
  652. short brs_what_is( char *item, char *file_in, long line_in,
  653.                    char *file, long *line, char *module )
  654. --------------------------------------------------------------------------------
  655. /* This function returns definition positions of the unknown item. To handle
  656.    scoping of local items, you can specify the position, where you found that 
  657.    item.
  658.    Note: scoping not implemented yet. The line_in is currently ignored
  659.  
  660.    item         ...   holds the name of the unknown item
  661.    file_in      ...   file, where item was found (may be "")
  662.    line_in      ...   line, where item was found (or -1)
  663.                       only valid if a filename is specified
  664.  
  665.    file         ...   file, where item was defined
  666.    line         ...   the line in the file, where item is defined
  667.    module       ...   module, the file belongs to (or "")
  668.  
  669.    return:  
  670.  
  671.    RET_VAR           Return variable-position
  672.  
  673.    RET_FUNCT         Return function-position
  674.  
  675.    RET_TYPEDEF       Returns typedef
  676.  
  677.    RET_STRUCT        Returns struct-identifier
  678.  
  679.    RET_ENUM          Returns enum-type-identifier
  680.  
  681.    RET_UNION         Returns union-identifier
  682.  
  683.    RET_MACRO         Returns macro definition
  684.                      Arguments: <macro>,<file>,<line>
  685.  
  686.        0        ...  O.K., function-info is stored in arguments
  687.             RET_END  ...  No more functions found
  688.             else     ...  error returned by get_brs_ret
  689.                           error-message in macro/file
  690.  */
  691.  
  692.     
  693.  
  694. ================================================================================
  695. Function   : get_brs_ret
  696. File       : intrface.c    Line 1340
  697. Length     : 204 Lines
  698. Declaration:
  699. short get_brs_ret(short command, int * server, short *r_flag, 
  700.                   char *arg1, char *arg2, char *arg3, char *arg4)
  701. --------------------------------------------------------------------------------
  702. /* Wait till a return is sent by server. Get return-code
  703.    the flag (if r_flag != NULL) and arguments
  704.  */
  705.  
  706.  
  707. ================================================================================
  708. Function   : send_brs_cmd
  709. File       : intrface.c    Line 1549
  710. Length     : 42 Lines
  711. Declaration:
  712. void send_brs_cmd( int server, short ret_code, short flag, char * arg1, char *arg2)
  713. --------------------------------------------------------------------------------
  714.  
  715. ================================================================================
  716. Function   : brs_get_item_pos
  717. File       : client.c    Line ??? (hand edited)
  718. Length     : ?? Lines
  719. Declaration:
  720. short brs_get_item_pos( char *item, char *file_in, long line_in,
  721.                         char *file, long *line)
  722. --------------------------------------------------------------------------------
  723. /* This function returns the definition position of a given item
  724.    which was found at given position (within an expression). It
  725.    differs from the other brs_get_..._pos functions, because it
  726.    provides a kind of scoping. It returns the position of the
  727.    item which is valid in the context of the given position.
  728.  
  729.    It is also independend from the type of the item so it can be
  730.    used for an identifier of an unknown type.
  731.  
  732.    INPUT:
  733.    item         ...   item
  734.    file_in      ...   file, where item was found
  735.    line_in      ...   line, where item was found
  736.  
  737.    OUTPUT 
  738.    (if ret-value is 0:)
  739.    file         ...   the file, where the item is defined
  740.    line         ...   linenumber, where item is defined
  741.  
  742.    (if ret-value if RET_ERROR)
  743.    file         ...   Error message 1
  744.  
  745.    return:  0        ...  O.K., variable-info is stored in arguments
  746.             else     ...  error returned by get_brs_ret
  747.  */
  748.  
  749. ================================================================================
  750. Function   : brs_cut
  751. File       : brs_extract.lex    Line ??? (hand edited)
  752. Length     : ?? Lines
  753. Declaration:
  754. short brs_cut(short type, char *s_file, char *t_id, long t_line, 
  755.               char **def_line, char ** comment, char**body)
  756. --------------------------------------------------------------------------------
  757.  
  758. /* cut's the definition line of a function and a possible leading
  759.    comment.
  760.  
  761.    type         ...  0 item is a function, 1 item is something else
  762.  
  763.    source_file  ...  file where the function is defined
  764.    target_id    ...  identifier of the function
  765.    target_line  ...  line, where function is defined (may be set
  766.                      between the identifier and the beginning of
  767.                      the function-body
  768.    comment      ...  pointer to a char-pointer; if NULL: do not
  769.                      extract comment
  770.    body         ...  pointer to a char-pointer; if NULL: do not
  771.                      extract body
  772.    
  773.  
  774.    Return-values:
  775.    def_line     ...  pointer to a malloced memory-area with the
  776.                      definition line ( '\0'-terminated )
  777.                      (or NULL if definition line could not found)
  778.    
  779.    comment      ...  pointer to the leading comment (malloc used)
  780.                      (or NULL if comment could not found)
  781.    
  782.    body         ...  pointer to the function body (malloc used)
  783.                      (or NULL if body could not found)
  784.    
  785.    return-value      0 ... O.K.
  786.                      1 ... item not found
  787.                     -1 ... not enough memory
  788.                     -2 ... file read or positioning error
  789.  */
  790.